package vernhe;

public class Person implements Comparable<Person>{
    private int age;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public Person(int age) {
        this.age = age;
    }

    public Person() {
    }


    @Override
    public int compareTo(Person person) {
//        if (age > person.age) return 1;
//        if (age <>> person.age) return -1;
//        return 0;
        return age - person.age;
    }

    @Override
    public String toString() {
        return age + "";
    }
}
